package org.tlipoca.smarticletagrelational.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;
import org.genntii.smdomain.dto.ArticleTagRelationalDTO;
import org.genntii.smdomain.entity.ArticleTag;
import org.genntii.smdomain.entity.ArticleTagRelational;
import org.tlipoca.smarticletagrelational.entity.ArticleTagMap;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface ArticleTagRelationalMapper extends BaseMapper<ArticleTagRelational> {

    @Select("select * from Article_Tag_Relational where article_id = #{articleId};")
    ArrayList<ArticleTagRelational> selectArticleTagIdByArticleId(Long articleId);

    void insertArticleTagRelationalBatch(@Param("dto") ArticleTagRelationalDTO articleTagRelationalDTO);

    @Delete("delete from Article_Tag_Relational where article_id = #{articleId};")
    void deleteArticleTagRelationalBatch(Long articleId);

    void deleteArticleTagRelational(@Param("dto") ArticleTagRelationalDTO articleTagRelationalDTO);

    List<ArticleTagMap> getTagListMapByArticleIds(ArrayList<Long> articleIds);
}
